package houseHold;

import houseHold.electricObjects.ElectricObjectType;
import houseHold.gasObjects.GasObjectType;
import houseHold.waterObjects.WaterObjectType;

/**
 * Class that selects which object is read from XML;
 * 
 * @author Minodor
 * 
 */
public class TypeSelector {

	public static ObjectType getObjectType(String s) {
		ElectricObjectType GE = ElectricObjectType.ELECTRIC_OBJECT;
		GasObjectType GG = GasObjectType.GAS_OBJECT;
		WaterObjectType GW = WaterObjectType.WATER_OBJECT;
		if (GE.getObject(s) != null)
			return GE.getObject(s);
		if (GG.getObject(s) != null)
			return GG.getObject(s);
		if (GW.getObject(s) != null)
			return GW.getObject(s);
		return null;
	}

	public static RoomType getRoomType(String s) {
		RoomType RR = RoomType.ROOM;
		if (RR.getRoom(s) != null)
			return RR.getRoom(s);
		return null;
	}
}
